#include "codebuilding.h"

CodeBuilding::CodeBuilding(TabManager* tabManager) : tabManager(tabManager)
{

}
void CodeBuilding::on_compile()
{
    QString destname = tabManager->filename;
    destname.replace(".c",".exe");
    QString command = "gcc -o " + destname + " " + tabManager->filename;
    system(command.toStdString().data());
}
void CodeBuilding::on_run()
{
    QString destname = tabManager->filename;
    destname.replace(".c",".exe");
    system(destname.toStdString().data());
}
